//木块
class BlockBean {
  int id = 0;
  String img = ""; //随机木块图片
  String defaultImg = ""; //默认棋盘木块图片 当normal=0才用
  int normal = 0; //1填与木块，0没有木块
  int eliminationEffect = 0; // normal =2时，1=消分特效，2背景闪烁
  int gem = 0; //normal=1且gem=1宝石，

  BlockBean(
      {this.id = 0,
      this.img = "",
      this.defaultImg = "",
      this.normal = 0,
      this.eliminationEffect = 0});
  BlockBean.fromJson(Map<String, dynamic> json) {
    //不要ID，否则会报错
    img = json['img'];
    defaultImg = json['defaultImg'];
    normal = json['normal'];
    eliminationEffect = json['eliminationEffect'];
    gem = json['gem'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
   //id不能写在这里，否则插入错误
    data['img'] = this.img;
    data['defaultImg'] = this.defaultImg;
    data['normal'] = this.normal;
    data['gem']=this.gem;
    data['eliminationEffect'] = this.eliminationEffect;
    return data;
  }
}

// json装实体类网址  https://jsontodart.com/

// {
//   "id":1,
//   "img":"",
//   "defaultImg":"",
//   "normal":0,
//   "eliminationEffect":0
// }
